<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set value="${pageContext.request.contextPath}" scope="page" var="ctx"></c:set>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String currRequestURL="";

	try{
		currRequestURL = request.getRequestURL().toString();
	}catch(Exception e){
	}
	System.out.println("currRequestURL:"+currRequestURL);
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>一键拉取/同步云筑网考勤数据到本机</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
<div>本页地址：http://localhost:8086/layuimini/index.html#/page/LOCALHOST-SynchronousAttendanceListNewBaseInfo.jsp</div>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>一键拉取/同步云筑网考勤数据到本机</legend>
        </fieldset>

        <form class="layui-form" action="">
            
              <div class="layui-form-item">
                <label class="layui-form-label">项目编号</label>
                <div class="layui-input-inline">
                    <input type="text" name="projectSysNo"  placeholder="项目编号" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">非必填，不填则拉取所有项目</div>
            </div>
            
            
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">考勤开始日期</label>
                    <div class="layui-input-inline">
                        <input type="text" name="beginDate" id="date1"  placeholder="年-月-日" autocomplete="on" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">非必填，不填则拉取最近几条的记录</div>
                </div>
            </div>

 <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">考勤结束日期</label>
                    <div class="layui-input-inline">
                        <input type="text" name="endDate" id="date2"  placeholder="年-月-日"  class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">非必填，不填则拉取最近几条的记录</div>
                </div>
            </div>
         
            
            
             <div class="layui-form-item">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-inline">
                    <input type="text" name="workName" placeholder="(非必填)，请输入姓名" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">非必填，不填则拉取当前项目下的所有工人</div>
            </div>
            
            
            
            
              <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" name="forsubmit" lay-filter="forsubmit">立即提交至DAO后台</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>

        <!-- 示例-970 -->
        <ins class="adsbygoogle" style="display:inline-block;width:970px;height:90px" data-ad-client="ca-pub-6111334333458862" data-ad-slot="3820120620"></ins>


    </div>
</div>

<script src="../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="../../../js/jquery-3.2.1.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date1'
        });
        laydate.render({
            elem: '#date2'
        });

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');

        //自定义验证规则
        form.verify({
	
           
        });

var fromdata1;
        //监听提交
        form.on('submit(demo1)', function (data) {
  	fromdata1 = JSON.stringify(data.field);
  	layer.confirm(JSON.stringify(data.field), {icon: 3, title:'最終提交的信息如下，确定提交吗？'}, function(index){
        //do something
               $.ajax({
     type: "POST",
     url: "../../page/SynchronousAttendanceListNewBaseInfo",
     dataType:"json",
     contentType : "application/json;charset=UTF-8",
     data: fromdata1,
     success: function (res) {
    	 console.log(res);
       /*   if (res.body) {
         	 
         	layer.alert(res.body);
         } else {
             layer.alert("no body");
         } */
     }
 });
        layer.close(index);
      });
  	
//     layer.alert(JSON.stringify(data.field), {
//         title: '最终的提交信息'
//           })

//          $.ajax({
//      type: "POST",
//      url: "../../page/SubmitTspBaseInfoToGWF",
//      dataType:"json",
//      contentType : "application/json;charset=UTF-8",
//      data: fromdata1,
//      success: function (res) {
//          if (res.body) {
//          	 console.log(res);
//          	layer.alert(res.body);
//          } else {
//              layer.alert("no body");
//          }
//      }
//  });
            
            return false;
        });



    });
</script>

</body>
</html>